package com.spancer.contentcenter.feignclient;

import com.spancer.contentcenter.configuration.GlobalFeignConfiguration;
import com.spancer.contentcenter.domain.dto.user.UserDTO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * author by: mars
 * Date: 2020/8/20 12:11
 * Description: 创建调用用户中心的feignclient
 * 1.代码版：
 * @FeignClient(
 *     name = "微服务名称"
 *     configuration = xxx.class   // feign自定义配置
 *   )
 *
 * 2.配置版：
 *  - 去掉@FeignClient的 configuration 配置
 *  - 在.yml中添加：
 *
 */
@FeignClient(name = "user-center",configuration = GlobalFeignConfiguration.class)
//@FeignClient(name = "user-center")
public interface UserCenterFeignClient {

    @GetMapping("/users/{id}")
    UserDTO findById(@PathVariable("id")Integer id);

}
